package com.hk.core.authentication.api.validatecode.sms;

import com.hk.commons.util.IDGenerator;
import com.hk.core.authentication.api.validatecode.AbstractValidateCodeGenerator;
import com.hk.core.authentication.api.validatecode.ValidateCodeGenerator;

/**
 * @author kevin
 * @date 2018-07-27 13:48
 */
public class SmsValidateCodeGenerator extends AbstractValidateCodeGenerator
        implements ValidateCodeGenerator<SmsValidateCode> {

    @Override
    public SmsValidateCode generate(SmsValidateCode validateCode) {
        return validateCode
                .setId(IDGenerator.uuid32().generate())
                .setCode(randomStringGenerator())
                .setExpireSecond(getExpireSends());
    }
}
